<template>
	<view>
		<template v-if="dataList.length">
			<view class="w-690 radius-20 padding bg-white" v-for="(item,index) in dataList" :key="index">
				<view class="flex justify-between align-center">
					<view class="text-30 text-bold">
						<text>{{item.title}}</text>
						<text class="padding-left-sm">{{item.total_amount}}元</text>
					</view>
					<view class="text-main">{{statusText[item.status]}}</view>
				</view>
				<view class="text-999 text-xs padding-top-sm">
					<text class="payTime-label">支付时间：</text>
					<text class="payTime-value">{{item.paytime?$u.timeFormat(item.paytime, 'yyyy年mm月dd日 hh时MM分ss秒'):"无"}}</text>
				</view>
				<view class="text-999 text-xs padding-top-sm">
					<text class="payTime-label">用户：</text>
					<text class="payTime-value">{{item.uname}}</text>
				</view>
				<view class="text-999 text-xs padding-top-sm">
					<text class="payTime-label">律师：</text>
					<text class="payTime-value">{{item.lname}}</text>
				</view>
			</view>
		</template>
		<template v-else>
			<view style="padding-top: 150rpx;">
				<u-empty text="暂无数据" mode="list"/>
			</view>
		</template>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				dataList: [],
				statusText: ['未支付', '已支付', '已完成']
			};
		},
		onLoad() {
			this.initData()
		},
		methods: {
			initData() {
				this.$u.api._myorders().then(res => {
					this.dataList = res.data.data;
					console.log(res.data.data);
				})
			}
		},
	}
</script>

<style lang="scss" scoped>
	.payTime-label{
		color: #666;
	}
	.payTime-value{
		color: #999;
	}
	.w-690 {
		margin: 20rpx auto 0 auto;
	}
</style>